<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
  <style>
    .box{
      width: 100px;
      height: 100px;
      background-color: red;
    }

    .s1{
      opacity: 0;
    }
    .s2,
    .s3{
      transition: all 2s ease-in;
    }
    .s4{
      opacity: 1;
    }
    .s5{
      opacity: 0;
    }
  </style>
</head>
<body>
  <div id="app"></div>
  <script src="js/vue.js"></script>
  <script>
    const app = Vue.createApp({
      data() {
        return {
          msg: '撩课学院',
          flag: false
        }
      },
      /*template: `
        <div>
           <transition
             enter-from-class="s1"
             enter-active-class="s2"
             enter-to-class="s4"
             leave-from-class=""
             leave-active-class="s3"
             leave-to-class="s5"
           >
               <div class="box" v-show="flag">{{msg}}</div>
           </transition>
           <button @click="flag = !flag">显示/隐藏</button>
        </div>
      `*/
      template: `
        <div>
           <transition
             enter-active-class="animate__animated animate__shakeX"
             leave-active-class="animate__animated animate__flash"
             :duration="{enter: 3000, leave: 3000}"
           >
               <div class="box" v-show="flag">{{msg}}</div>
           </transition>
           <button @click="flag = !flag">显示/隐藏</button>
        </div>
      `
    }).mount('#app');
  </script>
</body>
</html>
